using System.Xml.Serialization;

namespace Chaotic.DataBase.DBAccessLibrary.Model;

[Serializable]
[XmlInclude(typeof(ProcEntity))]
public class ViewEntity : DataBaseEntity
{
	public string Content { get; set; }

	public ViewEntity(string? name)
		: base(name)
	{
		base.ImageUrl = "/Images/Tree/view.png";
	}

	public override DataBaseEntity? Copy()
	{
		ViewEntity? viewEntity = new ViewEntity(base.Name);
		viewEntity.Content = Content;
		ViewEntity? viewEntity2 = viewEntity;
		Copy(viewEntity2);
		if (base.ChildNodes.Count > 0)
		{
			DataBaseEntity?[] array = base.ChildNodes.ToArray();
			foreach (DataBaseEntity? dataBaseEntity in array)
			{
				DataBaseEntity? dataBaseEntity2 = dataBaseEntity.Copy();
				if (dataBaseEntity2 != null)
				{
					viewEntity2.ChildNodes.Add(dataBaseEntity.Copy());
				}
			}
		}
		return viewEntity2;
	}
}
